16. Expression Quiz
Expression Quiz
Sometimes it can be a little tricky to convert a mockup or site with static content into a dynamic one. For example, here's a portion of a template:
<h1>Block Details</h1>
<ul>
<li>Green</li>
<li>2 x 4</li>
<li>$0.03</li>
</ul>
<p>
Colorful interlocking plastic bricks...
</p>
With the above info, the following data structure for the brick probably looks like:
{
color: 'Green',
size: '2 x 4',
price: 0.03,
description: 'Colorful interlocking plastic bricks...'
}
All in consideration, which of the sections above should be converted from hard-coded content into dynamic expressions?
QUESTION:
Should the following section be concerted from hard-coded content into a dynamic expression? If so, enter that expression below. If not, simply write static.
<h1>Block Details</h1>
SOLUTION:
NOTE: The solutions are expressed in RegEx pattern. Udacity uses these patterns to check the given answer
QUESTION:
Should the following section be concerted from hard-coded content into a dynamic expression? If so, enter that expression below. If not, simply write static.
<li>Green</li>
SOLUTION:
NOTE: The solutions are expressed in RegEx pattern. Udacity uses these patterns to check the given answer
QUESTION:
Should the following section be concerted from hard-coded content into a dynamic expression? If so, enter that expression below. If not, simply write static.
<li>2 x 4</li>
SOLUTION:
NOTE: The solutions are expressed in RegEx pattern. Udacity uses these patterns to check the given answer
QUESTION:
Should the following section be concerted from hard-coded content into a dynamic expression? If so, enter that expression below. If not, simply write static.
<li>$0.03</li>
SOLUTION:
NOTE: The solutions are expressed in RegEx pattern. Udacity uses these patterns to check the given answer
QUESTION:
Should the following section be concerted from hard-coded content into a dynamic expression? If so, enter that expression below. If not, simply write static.
<p>
Colorful interlocking plastic bricks...
</p>
SOLUTION:
NOTE: The solutions are expressed in RegEx pattern. Udacity uses these patterns to check the given answer
Solution
Expression Solution